<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="error.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<jsp:useBean class="show.Logche" id="che" scope="request" />
</head>

<body>
<%
       request.setCharacterEncoding("utf-8");
	   String name = null;
	   name = request.getParameter("name");
	   String pass = null;
	   pass = request.getParameter("pass");
	   int count = 0;
	   count = che.check(name,pass);
	   
	   if(count == 2)
	   {
	        out.print("<script>alert('密码错误！页面返回登陆页面');</script>");
			out.print("<script>window.location='login.jsp';</script>");
	   }else if(count == 3)
	   {
	        out.print("没有这个账号！<br />");
			out.print("回主页去创建一个吧！<a href='index.jsp'>返回首页</a>");
	   }
	   else
	   {
	        session.setAttribute("name",name);
			session.setAttribute("isLog",true);
			response.sendRedirect("info/main.jsp");
	   }
%>
</body>
</html>
